//
//  NBStatusRetweetedView.swift
//  NBSinaWeibo
//
//  Created by ac on 16/5/25.
//  Copyright © 2016年 ac. All rights reserved.
//

import UIKit


class NBStatusRetweetedView: UIView {

    private lazy var pictureView:NBStatusPictureView = NBStatusPictureView()
    
    var statusVM:NBStatusViewModel?{
        didSet{
            contentLabel.text = statusVM?.status?.retweeted_status?.text
            pictureView.pictures = statusVM?.status?.retweeted_status?.pic_urls
        }
    }
    
    
    private lazy var contentLabel: UILabel = UILabel(title: "呵呵呵", fontSize: 14, textAlign: .Left, textColor: UIColor.darkGrayColor())
    
    override init(frame: CGRect) {
        super.init(frame: frame)
        self.backgroundColor = UIColor(white: 0.9, alpha: 1)
        setupUI()
    }
    
    private func setupUI(){
        addSubview(contentLabel)
        addSubview(pictureView)
        
        contentLabel.snp_makeConstraints { (make) in
            make.top.left.equalTo(self).offset(CellMargin)
        }
        
        pictureView.snp_makeConstraints { (make) in
            make.top.equalTo(contentLabel.snp_bottom).offset(CellMargin)
            make.left.equalTo(contentLabel.snp_left)
        }

        
        self.snp_makeConstraints { (make) in
            make.bottom.equalTo(pictureView)
        }
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

}
